#! /bin/bash
# 在本目录执行脚本
shDir=$(cd `dirname $0`; pwd)
cd ${shDir}

echo 'VSCodium配置'

# 变量声明
. ../func/const.sh
. ../func/file.sh
## 应用程序所在目录
appSource="${appDir}/vscodium"

# 排除目标目录的旧文件
mkFileOld "${uzerConf}" 'VSCodium'
mkFileOld "${homeDir}" '.vscode-oss'
mkFileOld "${homeDir}" '.lingma'
mkFileOld "${appLauncher}" 'vscodium.desktop'
mkFileOld "${uzerBin}" 'vscodium'
# 创建软链接到libDir/app
## 链接应用配置文件
ln -sf "${appSource}/vscodium.conf/VSCodium" "${uzerConf}/VSCodium"
### 扩展程序
ln -sf "${appSource}/vscodium.conf/.vscode-oss" "${homeDir}/.vscode-oss"
ln -sf "${appSource}/vscodium.conf/.lingma" "${homeDir}/.lingma"
## 链接应用启动器
echo '- 创建启动器'
ln -sf "${appSource}/vscodium.desktop" "${appLauncher}/vscodium.desktop"
## 注册bin变量
echo '- 注册变量'
ln -sf "${appSource}/vscodium.exec" "${uzerBin}/vscodium"
